package com.sloan.community.repository;

import com.sloan.community.po.CommentLikeCount;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.Collection;
import java.util.List;

@Repository
public interface CommentLikeCountRepository extends R2dbcRepository<CommentLikeCount, Long> {

    Flux<CommentLikeCount> findByArticleId(Long articleId);

    Flux<CommentLikeCount> findByCommentIdIsIn(List<Long> commentIds);

    Mono<CommentLikeCount> findByCommentIdAndUserId(Long commentId, Long userId);

    Mono<Void> deleteByCommentIdAndUserId(Long commentId, Long userId);
}
